// 统一UI toast等 方便更换UI库
import { ElMessage, ElMessageBox } from "element-plus"
import type { MessageBoxData } from 'element-plus'
const ui = {
  alert: (message: string) => ElMessage.error(message),
  toast: (message: string) => ElMessage.info(message),
  success: (message: string) => ElMessage.success(message),
  warning: (message: string) => ElMessage.warning(message),
  confirm: (message: string, title: string): Promise<MessageBoxData> => ElMessageBox.confirm(message, title)
}
export default defineNuxtPlugin(() => {
  return {
    provide: ui
  }
})